<?php

use App\Http\Controllers\GuestbookController;
use App\Http\Controllers\IndexController;
use App\Http\Controllers\InfoController;
use App\Http\Controllers\InfoNewsController;
use App\Http\Controllers\InfoPageController;
use App\Http\Controllers\InfoPictureController;
use App\Services\InfoCategoryService;
use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::middleware(['viewLog:1'])->group(function () {

    // 首页
    Route::get('/', [IndexController::class, 'index']);

    // 栏目路由
    InfoCategoryService::makeSeoRoute();
    Route::get('channel/{cate}.html', [InfoController::class, 'index'])->name('infoChannel');
    Route::get('list/{cate}.html', [InfoController::class, 'list'])->name('infoList');
    Route::get('page/{cate}.html', [InfoPageController::class, 'index'])->name('infoPage');

    // 信息详情页
    Route::get('show/{cate}.{info}.html', [InfoController::class, 'show'])->name('infoShow');

    // 留言咨询
    Route::get('guestbook.html', [GuestbookController::class, 'index'])->name('guestbook.index');
    Route::put('guestbook.html', [GuestbookController::class, 'store'])->name('guestbook.store');
});






